<?php

class Application_Form_GestionGroupe_ChangeNameForm extends Zend_Form
{
  public function init()
  {
    $this->setName('changename')
      ->setAttrib('name','changename');

    $id = new Zend_Form_Element_Hidden('id');

    $nom = new Zend_Form_Element_Text('nom');
    $nom->setLabel('Nouveau nom : ')
      ->setRequired('true')
      ->addFilter('StripTags')
      ->addFilter('StringTrim')
      ->addValidator('NotEmpty')
      ->setDecorators(array('ViewHelper','FormErrors','Errors'));

    $send = new Zend_Form_Element_Submit('send');
    $send->setAttrib('id','send_button')
      ->setLabel('Enregistrer')
      ->setAttrib('class','button')
      ->setDecorators(array('ViewHelper','FormErrors','Errors')); 

    $cancel = new Zend_Form_Element_Reset('cancel');
    $cancel->setAttrib('id','send_button')
      ->setLabel('Annuler')
      ->setAttrib('class','button')
      ->setDecorators(array('ViewHelper','FormErrors','Errors')); 

    $this->addElements(array($id,$nom,$send,$cancel));
  }
}